package architect.design.patterns.creation.simplefactory;

/**
 * 简单工厂模式
 *
 * @author guanxin
 * @date 2018/5/4 11:40
 */

public class SimpleFactoryCase {

    public static void main(String[] args) {
        IComputerFactory simpleFactory = new ComputerFactory();
        // 使用简单工厂创建一台笔记本电脑
        IComputer computer = simpleFactory.createComputer(ComputerType.LapTop);
        computer.swithOn();
        computer.switchOff();
    }
}
